
package com.hlkj.pay.infrastructure.mapper.order;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hlkj.framework.mybatis.core.mapper.BaseMapperX;
import com.hlkj.framework.mybatis.core.query.QueryWrapperX;
import com.hlkj.pay.dto.merchant.MerchantAccessInfoPageQueryDto;
import com.hlkj.pay.dto.order.*;
import com.hlkj.pay.infrastructure.model.order.OrderStatisticsDO;
import com.hlkj.pay.infrastructure.model.order.PayOrderDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author HlpayTeam
 * @date 2024/11/08 13:28
 */
@Mapper
public interface OrderStatisticsMapper extends BaseMapperX<OrderStatisticsDO> {

    /**
     *
     * @param orderStatisticsDO
     */
    void updateStatistics(@Param("statistics") OrderStatisticsDO orderStatisticsDO);

    /**
     *
     * @param orderStatisticsQueryDto
     * @return
     */
    OrderStatisticsDO queryStatistics(@Param("query") OrderStatisticsQueryDto orderStatisticsQueryDto);

    /**
     * 
     * @param mpPage
     * @param orderStatisticsQueryDto
     * @return
     */
    IPage<OrderStatisticsGroupDto> queryGroupPage(IPage<OrderStatisticsGroupDto> mpPage, @Param("ew") QueryWrapperX<OrderStatisticsGroupDto> queryWrapper);
    List<OrderStatisticsGroupDto> queryGroupPage(@Param("ew") QueryWrapperX<OrderStatisticsGroupDto> queryWrapper);
    
    IPage<OrderStatisticsDO> queryCommonPage(IPage<MerchantAccessInfoPageQueryDto> mpPage,@Param("ew") LambdaQueryWrapper<OrderStatisticsDO> queryWrapper);

    List<OrderStatisticsDO> queryCommonPage(@Param("ew") LambdaQueryWrapper<OrderStatisticsDO> queryWrapper);

    IPage<OrderStatisticsDto> queryMchChannelCodePage(IPage<MerchantAccessInfoPageQueryDto> mpPage, @Param("ew") QueryWrapper<OrderStatisticsDO> queryWrapper);

    List<OrderStatisticsDto> queryMchChannelCodePage(@Param("ew") QueryWrapper<OrderStatisticsDO> queryWrapper);
    
    IPage<OrderStatisticsDO> queryAgentPage(IPage<MerchantAccessInfoPageQueryDto> mpPage,  @Param("ew") QueryWrapper<OrderStatisticsDO> queryWrapper);

    List<OrderStatisticsDO> queryAgentPage(@Param("ew") QueryWrapper<OrderStatisticsDO> queryWrapper);

    /**
     *
     * @param ids
     * @param remark
     * @return
     */
    int updateRemark(@Param("ids") List<Long> ids, @Param("remark") String remark);


    /**
     *
     * @param payOrderQueryDto
     */
    OrderPageStatisticsDto queryStaticOrdersPage(@Param("query") PayOrderQueryDto payOrderQueryDto);

    RouterOrderDataDto querySuccessOrder(@Param("ew") LambdaQueryWrapper<PayOrderDO> payOrderDOLambdaQueryWrapper);

    RouterOrderDataDto querySuccessOrderAmount(@Param("ew") LambdaQueryWrapper<PayOrderDO> payOrderDOLambdaQueryWrapper);

    IPage<OrderStatisticsDto> queryChannelCodePage(IPage<MerchantAccessInfoPageQueryDto> mpPage, @Param("ew") QueryWrapper<OrderStatisticsDO> queryWrapper);

    List<OrderStatisticsDto> queryChannelCodePage(@Param("ew") QueryWrapper<OrderStatisticsDO> queryWrapper);

    IPage<OrderStatisticsDto> queryAutCodePage(IPage<MerchantAccessInfoPageQueryDto> mpPage, @Param("ew") QueryWrapper<OrderStatisticsDO> queryWrapper);

    List<OrderStatisticsDto> queryAutCodePage(@Param("ew") QueryWrapper<OrderStatisticsDO> queryWrapper);
}
